﻿using System;
using NUnit.Framework;
using Smartkernel;

namespace Smartkernel.NUnitTest.
{
    [Category("Core")]
    [TestFixture]
    public class SmartMessageQueueTest
    {
        [Test]
        public void Test()
        {
            ////【01】消息队列的测试（涉及方法：Send、Peek、Receive）
            //string address = @"FormatName:Direct=TCP:192.168.1.205\private$\SKMQDEMO";
            //for (int i = 0; i < 10; i++)
            //{
            //    //消息队列实体
            //    SmartMessageEntity smartMessageEntity = new SmartMessageEntity(Guid.NewGuid().ToString(), DateTime.Now.Ticks.ToString());
            //    //向消息队列写入消息
            //    SmartMessageQueue.Send(address, smartMessageEntity);
            //}
            //for (int i = 0; i < 10; i++)
            //{
            //    //从消息队列弹出消息，但不移除
            //    SmartMessageEntity smartMessageEntity = SmartMessageQueue.Peek(address);
            //}
            //for (int i = 0; i < 10; i++)
            //{
            //    //从消息队列中弹出消息，且删除
            //    SmartMessageEntity smartMessageEntity = SmartMessageQueue.Receive(address);
            //}
        }
    }
}
